Date.prototype.format = function (format) {
    var d = {
        "M+": this.getMonth() + 1, //月份
        "d+": this.getDate(),    //日
        "h+": this.getHours(),   //时
        "m+": this.getMinutes(), //分
        "s+": this.getSeconds(), //秒
        "S": this.getMilliseconds() //毫秒
    }
    //是否存在y，存在则根据规则替换
    if (/(y+)/.test(format)) {
        format = format.replace(RegExp.$1,
            (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
//遍历d，根据format存在的规则替换
    for (var k in d) {
        if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                RegExp.$1.length == 1 ? d[k] :
                    ("00" + d[k]).substr(("" + d[k]).length));
    }
    return format;
}

import App from './App'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
import './interceptor.js'
import uView from 'uview-ui'
import Common from './config/common.js'
import PH from './config/path.js'
import Api from './config/api.js'
import CuNavbar from "./components/cu-navbar/cu-navbar";
Vue.component('CuNavbar',CuNavbar)
Vue.use(uView)
Vue.prototype.$api = {}
Vue.prototype.$common = {}
Vue.prototype.$api = {}
Vue.use(Common)
Vue.use(PH)
const app = new Vue({
    ...App
})

Vue.use(Api, app)
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif
